package com.ice.work.moment.user.dao.resource;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ice.work.moment.facade.user.model.Resource;
import com.ice.work.moment.facade.user.request.PageResourceRequest;
import org.springframework.stereotype.Component;

/**
 * @Description user dao
 * @Author DELL
 * @Create 2019-01-10
 * @Since 1.0.0
 */
@Component
public class ResourceRepository extends ServiceImpl<IResourceMapper, Resource> implements IResourceRepository {


    @Override
    public Resource findBySignAndDataStatus(String sign,Integer dataStatus) {
        return this.baseMapper.selectOne(new QueryWrapper<Resource>().lambda().eq(Resource::getSign, sign).eq(Resource::getDataStatus, dataStatus));
    }

    @Override
    public IPage<Resource> page(IPage<Resource> page, PageResourceRequest resourceRequest) {
        return this.baseMapper.page(page,resourceRequest);
    }

}


